//
//  HMSportTrack.h
//  HMSport
//
//  Created by apple on 2017/4/21.
//  Copyright © 2017年 itheima. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MAMapKit/MAMapKit.h>
#import "HMSportPolyline.h"

typedef enum : NSUInteger {
    HMSportTypeRunning,  //跑步
    HMSportTypeRiding,  //骑行
    HMSportTypeWalking, //步行
} HMSportType;  //运动类型


typedef enum : NSUInteger {
    HMSportStateContinue, //继续
    HMSportStatePause,  //暂停
    HMSportStateFinish,  //结束
} HMSportState;   //运动状态

typedef enum : NSUInteger {
    HMSportGPSStateDisconnect, // 断开
    HMSportGPSStateBad,   //差
    HMSportGPSStateNormal,  //一般
    HMSportGPSStateGood,   //好
} HMSportGPSState; //GPS状态


//运动轨迹模型  记录运动轨迹相关的数据(轨迹折线,轨迹颜色,轨迹距离..)
@interface HMSportTrack : NSObject
//起点大头针模型
@property (nonatomic, strong, readonly) MAPointAnnotation *startAnno;
//运动类型
@property (nonatomic, assign, readonly) HMSportType sportType;
//运动类型图片名
@property (nonatomic, copy, readonly) NSString *sportTypeImgName;

//运动状态
@property (nonatomic, assign) HMSportState sportState;
//总距离  km
@property (nonatomic, assign, readonly) CGFloat totalDistance;
//总时长  s
@property (nonatomic, assign, readonly) CGFloat totalTime;
//时间字符串
@property (nonatomic, copy, readonly) NSString *timeStr;

//最大速度  km/hour
@property (nonatomic, assign, readonly) CGFloat maxSpeed;
//平均速度  km/hour
@property (nonatomic, assign, readonly) CGFloat avgSpeed;

/**
 开始运动

 @param sportType 运动类型
 @param state 运动状态
 @return 运动轨迹模型
 */
- (instancetype)initWithSportType:(HMSportType)sportType withSportState:(HMSportState)state;

/**
 添加折线

 @param dest 折线终点
 @return 折线模型
 */
- (HMSportPolyline *)appendPolylineWithDest:(CLLocation *)dest;

@end
